<template>
  <div class="header">
    <div class="header-left">
      <span class="iconfont back-icon">&#xe743;</span>
    </div>
    <div class="header-middle">
      <span class="iconfont">&#xe64d;</span>
      输入城市/景点/游玩主题
    </div>
    <router-link to="/city">
      <div class="header-right">
        {{  city }}
        <span class="iconfont sclect-icon">&#xe627;</span>
      </div>
    </router-link>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: "HomeHeader",
  computed:{
    ...mapState(['city'])
  }
};
</script>

<style lang="stylus" scoped>
@import '~@/assets/style/variable.styl';

.header {
  line-height: $headerHeight;
  background-color: $bgColor;
  color: #fff;
  display: flex;

  .header-left {
    float: left;
    width: 0.64rem;
  }

  .header-middle {
    flex: 1;
    height: 0.64rem;
    line-height: 0.64rem;
    margin-top: 0.12rem;
    margin-left: 0.2rem;
    background: #fff;
    border-radius: 0.1rem;
    color: #ccc;
  }

  .header-right {
    float: right;
    text-align: center;
    mid-width: 1.04rem;
    padding: 0 0.1rem; 
    color: #fff;
  }

  .back-icon {
    text-align: center;
    font-size: 0.5rem;
    margin-left: 0.15rem;
  }

  .select-icon {
    font-size: 0.4rem;
  }
}
</style>